﻿using System;
using System.Globalization;
using System.IO;
using easy_ccms.core.Interfaces;

namespace easy_ccms.core
{
 //   /// <summary>
 //   /// Text log enables user to log text in log directory in root level of application.
    ///// </summary>
    ////public class TextLog: ILog
    //{
        /////// <summary>
//        /// Logs the error message.
        /////// </summary>
//        /// <param name="message">The message.</param>
        /////// <param name="location">The location.</param>
//        public void LogErrorMessage(string message, string location)
        ////{
            //try
////            {
                //string path = "~/Log/" + DateTime.Today.ToString("dd-mm-yy") + ".txt";
////                if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
                //{
                    ////File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();
                //}
////                using (StreamWriter w = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(path)))
                //{
                    ////w.WriteLine("\r\nLog Entry : ");
//                    w.WriteLine("{0}", DateTime.Now.ToString(CultureInfo.InvariantCulture));
                    ////string err = "Error in: " + System.Web.HttpContext.Current.Request.Url.ToString() +
                                  //". Error Message:" + message + "location:" + location;
                    ////w.WriteLine(err);
//                    w.WriteLine("__________________________");
                    ////w.Flush();
//                    w.Close();
                ////}
            //}
////            catch
            //{
                //////do nothing
            //}
        ////}
//
        /////// <summary>
//        /// Logs the notify message.
        /////// </summary>
//        /// <param name="message">The message.</param>
        /////// <param name="location">The location.</param>
//        public void LogNotifyMessage(string message, string location)
        ////{
            //try
////            {
                //string path = "~/Log/" + DateTime.Today.ToString("dd-mm-yy") + ".txt";
////                if (!File.Exists(System.Web.HttpContext.Current.Server.MapPath(path)))
                //{
                    ////File.Create(System.Web.HttpContext.Current.Server.MapPath(path)).Close();
                //}
////                using (StreamWriter w = File.AppendText(System.Web.HttpContext.Current.Server.MapPath(path)))
                //{
                    ////w.WriteLine("\r\nLog Entry : ");
//                    w.WriteLine("{0}", DateTime.Now.ToString(CultureInfo.InvariantCulture));
                    ////string msg = "Nofify in: " + System.Web.HttpContext.Current.Request.Url.ToString() +
                                  //". Nofity Message:" + message + "location:" + location;
                    ////w.WriteLine(msg);
//                    w.WriteLine("__________________________");
                    ////w.Flush();
//                    w.Close();
                ////}
            //}
////            catch
            //{
                //////do nothing
            //}
        ////}
    //}
////
    //
	}
